
package com.android.replace;

import java.io.File;

public class ReplaceBootAnimation {
    public static void main(String[] args) {
        list("C:\\Users\\yl1132\\Desktop\\bootanimation\\part1");
    }

    private static void list(String dir) {
        File root = new File(dir);
        File[] listFiles = root.listFiles();
        if (listFiles != null) {
            for (File file : listFiles) {
                if (file.isFile()) {
                    String newName = file.getName();
                    if (newName.length() == 6) {
                        newName = "0" + newName;
                    }
                    File newFile = new File(file.getParentFile().getAbsoluteFile(), "yealink_"
                            + newName);
                    file.renameTo(newFile);
                }
            }
        }
    }

}
